﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">

    <Style x:Key="{x:Type ListBoxItem}"
           BasedOn="{StaticResource {x:Type ListBoxItem}}"
           TargetType="{x:Type ListBoxItem}">
        <Setter Property="Background" Value="{DynamicResource BackgroundBrush}" />
        <Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
        <Setter Property="Height" Value="{DynamicResource ListItemHeight}" />
        <Setter Property="HorizontalContentAlignment" Value="Stretch" />
        <Setter Property="IsTabStop" Value="False" />
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="{x:Type ListBoxItem}">
                    <Border Name="ListBoxItemBorder">
                        <ContentPresenter Margin="4,1,4,1" />
                    </Border>
                    <ControlTemplate.Triggers>
                        <Trigger Property="IsSelected" Value="True">
                            <Setter TargetName="ListBoxItemBorder" Property="Background" Value="{DynamicResource ForegroundBrush}" />
                        </Trigger>
                    </ControlTemplate.Triggers>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>